Retrievers
Retrievers are responsible for finding information relevant to a query from a knowledge source. In a Retrieval-Augmented Generation (RAG) system, a retriever receives a query and returns relevant documents, chunks, or records that can then be used as context for an agent or language model. BindAI provides a retrieval layer that supports multiple retrieval strategies, including:- Vector retrieval
- BM25 retrieval
- Hybrid retrieval
- Retrieval configuration
- Search options
- Metadata filtering
- Reranking integration
- Conversational retrieval
Retrieval Architecture
A typical BindAI Knowledge retrieval flow is:Retriever Responsibilities
A retriever generally performs four main tasks:- Receive a query.
- Search available knowledge.
- Rank or select relevant results.
- Return those results to the calling application or agent.
Vector Retrieval
Vector retrieval uses embeddings to find semantically related content. The general flow is:BM25 Retrieval
BM25 is a lexical retrieval strategy based on term matching and relevance scoring. The general flow is:Hybrid Retrieval
Hybrid retrieval combines multiple retrieval signals. BindAI provides hybrid retrieval that can combine lexical and vector-oriented retrieval. A conceptual flow is:Retrieval Strategy Comparison
There is no universally best strategy.
Applications should select the retrieval approach according to the structure of their knowledge and expected query patterns.
Retrieval Results
A retrieval operation normally produces a collection of candidate results. Conceptually:Top-K Retrieval
Retrieval systems commonly limit the number of returned results using a result limit or top-K style configuration. For example:- Document size
- Query complexity
- Retrieval quality
- Model context capacity
- Reranking strategy
- Application requirements
Metadata Filtering
Metadata can be used to restrict retrieval results. For example:- Tenant isolation
- Document categories
- Versions
- Content types
- Application-defined scopes
Search Options
BindAI provides search configuration/options that allow retrieval behavior to be controlled without coupling applications to one specific retrieval strategy. Depending on the configured retrieval implementation, search behavior can include concepts such as:- Result limits
- Retrieval strategy
- Metadata filtering
- Similarity-based retrieval
- Lexical retrieval
- Hybrid retrieval
- Reranking
Reranking
Retrieval and reranking solve different problems. The retriever finds candidate results. The reranker can then reorder those candidates.- Vector retrieval
- BM25 retrieval
- Hybrid retrieval
Lexical Reranking
BindAI includes lexical reranking as a concrete reranking implementation. Lexical reranking uses query and result text to refine the ordering of candidate results. Conceptually:Retrieval and Embeddings
Vector retrieval depends on embeddings. The general architecture is:Retrieval and Documents
Documents are normally processed before retrieval. A typical Knowledge ingestion flow is:Retrieval and Knowledge
Knowledge provides the information being searched. Retrieval provides the mechanism for selecting relevant information.
Conceptually:
Retrieval and Agents
Retrieval can be integrated with an agent’s Knowledge configuration. The general execution flow is:Retrieval Context
Retrieved information is useful because it provides context for model generation. For example:Conversational Retrieval
Retrieval can also be used in conversational applications. A conversational retrieval system can use the current question together with relevant conversation context when constructing the retrieval query. Conceptually:Retrieval in Workflows
Retrieval can participate in larger workflows. For example:Custom Retrieval Systems
Applications may also integrate external search systems when required. Potential external systems include:- SQL databases
- Search engines
- Vector databases
- REST APIs
- Enterprise search systems
- Graph databases
- Cloud search services
Retrieval Quality
Retrieval quality is influenced by several stages of the Knowledge pipeline.Choosing a Retrieval Strategy
Use BM25 when:
- Exact terminology matters.
- Queries contain identifiers or names.
- Lexical matching is important.
- Documents contain specialized vocabulary.
Use vector retrieval when:
- Queries are naturally expressed in different wording from the source.
- Semantic similarity is important.
- The knowledge contains descriptive or conceptual content.
Use hybrid retrieval when:
- Both exact terms and semantic similarity matter.
- The knowledge contains technical terminology mixed with natural language.
- A single retrieval strategy does not provide sufficient coverage.
Retrieval Security
Retrieval systems can expose information from private knowledge sources. Applications should consider:- Tenant isolation
- Access control
- Metadata filtering
- Source permissions
- Data retention
- Secure storage
- Query authorization
Retrieval Performance
Retrieval performance depends on factors such as:- Knowledge size
- Chunk count
- Embedding dimensions
- Vector storage
- Query complexity
- Retrieval strategy
- Filtering
- Reranking
- Result limits
Testing Retrievers
Retriever testing should use representative queries and known relevant information. A useful test set can contain:Retrieval and RAG
Retrieval is a central stage of RAG. A typical BindAI-oriented RAG architecture is:Current Retrieval Capabilities
The current BindAI retrieval implementation includes:- Retrieval abstractions
- Vector retrieval
- BM25 retrieval
- Hybrid retrieval
- Search configuration
- Search options
- Metadata filtering
- Reranking abstraction
- Lexical reranking
- Conversational retrieval
- Knowledge integration
- Agent integration
Relationship to Memory
Retrieval and Memory should not be confused.- In-memory
- SQLite
- PostgreSQL
- Vector memory
- Pinecone
- Chroma
Relationship to Tools
Tools perform executable operations. Retrievers search information. For example:Best Practices
- Choose retrieval strategies based on the actual query patterns.
- Use vector retrieval for semantic similarity.
- Use BM25 for strong lexical matching.
- Use hybrid retrieval when both signals are valuable.
- Keep result limits appropriate to the model context.
- Preserve useful metadata.
- Use metadata filtering for retrieval scope.
- Apply reranking when additional relevance refinement is needed.
- Test retrieval independently from generation.
- Use representative queries when evaluating retrieval quality.
- Monitor retrieval latency separately from model latency.
- Keep tenant and authorization boundaries explicit.
- Treat retrieved content as potentially untrusted external data.
- Re-evaluate retrieval after major changes to chunking or embeddings.
- Keep retrieval configuration separate from model-provider configuration.
